﻿using MediatR;
using T.Vehicleservice.API.Application.Command.ViolationRecordCommand;
using T.Vehicleservice.Domain.T.ViolationRecords.Model;
using T.Vehicleservice.Repository.Interface;

namespace T.Vehicleservice.API.Application.CommandHandlers.ViolationRecordHandler
{
    /// <summary>
    /// 反填违章信息
    /// </summary>
    public class ViolationRecordGetByCommandHander : IRequestHandler<ViolationRecordGetByCommand, ViolationRecord>
    {
        private readonly IViolationRecordRepository _violationRecordRepository;
        public ViolationRecordGetByCommandHander(IViolationRecordRepository violationRecordRepository)
        {
            _violationRecordRepository = violationRecordRepository;
        }
        public async Task<ViolationRecord> Handle(ViolationRecordGetByCommand request, CancellationToken cancellationToken)
        {
            return await _violationRecordRepository.GetModelAsync(request.ViolationRecordsId);
        }
    }
}
